package com.artqiyi.dollmachine.presenter;

import com.artqiyi.dollmachine.common.constant.ServerConstant;
import com.artqiyi.dollmachine.presenter.base.BasePresenter;
import com.artqiyi.dollmachine.presenter.base.PresenterCallbackCollection;
import com.artqiyi.dollmachine.utils.Callback.MyStringCallback;
import com.artqiyi.dollmachine.utils.JSONUtils;
import com.artqiyi.dollmachine.utils.manager.HttpManager;
import com.artqiyi.dollmachine.utils.respone.BannerRespone;
import com.artqiyi.dollmachine.utils.respone.CoinBuyRespone;
import com.artqiyi.dollmachine.utils.respone.ConfigRespone;
import com.artqiyi.dollmachine.utils.respone.DollListRespone;

import java.util.HashMap;
import java.util.Map;

import okhttp3.Call;

/**
 * Created by Administrator on 2017/10/26 0026.
 */

public class PayPresenter extends BasePresenter {

    public void getCoinBuy() {
        HttpManager.getHttpRequest(ServerConstant.getCoinBuy(), null, new MyStringCallback() {
            @Override
            public void onError(Call call, Exception e, int id) {
                ((PresenterCallbackCollection.PayFragmentCallBack) mCallback).onCoinBuyFail(e.getMessage());
            }

            @Override
            public void onResponse(String response, int id) {
                CoinBuyRespone coinBuyRespone = JSONUtils.jsonString2Bean(response, CoinBuyRespone.class);
                ((PresenterCallbackCollection.PayFragmentCallBack) mCallback).onCoinBuySuccess(coinBuyRespone.getData());
            }
        });
    }
}
